<template>
  <a-form @submit="handleSubmit">
    <a-form-item v-for="(item, index) in gathering" :key="index" :field="item.filed" :label="item.label">
      <a-input v-if="item.isInput" v-model="item.value" :placeholder="item.placeholder" />
      <a-select v-else-if="item.isSelect" placeholder="全部">
        <a-option>Beijing-Beijing-Beijing</a-option>
        <a-option>Shanghai</a-option>
        <a-option>Guangzhou</a-option>
      </a-select>
      <a-range-picker v-else-if="item.isRangePicker" @change="onChange" @select="onSelect" />
    </a-form-item>
  </a-form>
</template>
<script lang="ts">
import importConfig from './editForm';

export default {
  name: 'EditForm',
  props: {
    gathering: {
      type: Array,
      default: () => [],
    },
  },
  emits: [],
  setup(props, { emit }) {
    const { search, reset, init } = importConfig(props, { emit });
    init();
    return {
      search,
      reset,
    };
  },
};
</script>
<style lang="less" scoped>
.formHeader {
  &-criteria {
    flex: 1 1 0;
  }

  &-btn {
    border-left: 1px solid #ddd;
    flex: 0 0 86px;
    text-align: right;
  }
}
</style>
